package cn.elane.kibana.demo.global.util;


import cn.elane.kibana.demo.global.model.NameBean;

public class PrintUtil {
    private static final boolean DEBUG = true;

    public static void println(String message) {
        if (DEBUG) {
            System.out.println(" \n★ " + message);
        }
    }

    public static void println(NameBean message) {
        if (DEBUG) {
            System.out.println(" \n★ " + message.toJson());
        }
    }

    public static void println(Object message) {
        if (DEBUG) {
            System.out.println(" \n★ " + message);
        }
    }

    public static void println(String[] message) {
        if (DEBUG) {
            System.out.println(" \n★ " + message.toString());
        }
    }

    public static void println(Exception e) {
        if (DEBUG) {
            e.printStackTrace();
        }
    }

    public static void println(Class<?> clazz, String message) {
        if (DEBUG) {
            System.out.println(" ★ " + clazz.getName() + ":" + message);
        }
    }

    public static void println(Class<?> clazz, Exception e) {
        if (DEBUG) {
            System.out.println(" ★ " + clazz.getName() + ":" + e.getMessage());
            e.printStackTrace();
        }
    }
}
